//
//  LJJGoodsDetailContentView.m
//  shopTest
//
//  Created by 梁佳佳 on 2016/11/18.
//  Copyright © 2016年 梁佳佳. All rights reserved.
//

#import "LJJGoodsDetailContentView.h"
#import "LJJDetailContentModel.h"

@interface LJJGoodsDetailContentView ()

@end

@implementation LJJGoodsDetailContentView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
- (void)setContentArray:(NSArray *)contentArray
{
    _contentArray = contentArray;
    CGFloat height = 13;
    for (LJJDetailContentModel *model in contentArray) {
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, height, 60, 12)];
        titleLabel.font = [UIFont systemFontOfSize:12.0];
        titleLabel.text = model.Title;
        [self addSubview:titleLabel];
        CGFloat contentHeight = [NSString configLabelHeight:model.Value width:WIDTH - 185 font:[UIFont systemFontOfSize:13.0]];
        UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(75, height, WIDTH - 185, contentHeight)];
        contentLabel.text = model.Value;
        contentLabel.font = [UIFont systemFontOfSize:12.0];
        contentLabel.numberOfLines = 0;
        [self addSubview:contentLabel];
        height = height + contentHeight + 15;
    }
    if (_heightBlock) {
        _heightBlock(height);
    }
}
#pragma mark -
#pragma mark - method

#pragma mark -
#pragma mark - lazy method

@end
